package com.ai.aicontact.execmgn.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ai.aicontact.busi.entity.ExecInstruction;
import com.ai.aicontact.busi.service.ExecInstService;
import com.ai.aicontact.common.vo.Grid;
import com.ai.aicontact.common.vo.PageFilter; 
@Controller
public class ExecMgnController {

	@Autowired
	private ExecInstService execInstService;

	@ResponseBody
	@RequestMapping("queryExecInstuction")
	public Grid queryExecInstuction(String keyWord, ExecInstruction execInstruction, PageFilter pf) throws Exception {
		Grid grid = new Grid();
		List<ExecInstruction> rows = execInstService.queryExecInstuction(keyWord, execInstruction, pf);
		Long total = execInstService.countExecInstuction(keyWord, execInstruction);
		grid.setRows(rows);
		grid.setTotal(total);
		return grid;
	}
}
